package domains;
// Generated 2011-6-24 15:42:03 by Hibernate Tools 3.2.1.GA


import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * Users generated by hbm2java
 */
@Entity
@Table(name="users"
    ,catalog="netexperiment"
    , uniqueConstraints = @UniqueConstraint(columnNames="loginName") 
)
public class Users  implements java.io.Serializable {


     private Integer id;
     private String loginName;
     private String nick;
     private String pwd;
     private Character status;
     private String ip;
     private Integer port;
     private Set<Friends> friendsesForOwner = new HashSet<Friends>(0);
     private Set<Friends> friendsesForFriend = new HashSet<Friends>(0);

    public Users() {
    }

    public Users(String loginName, String nick, String pwd, Character status, String ip, Integer port, Set<Friends> friendsesForOwner, Set<Friends> friendsesForFriend) {
       this.loginName = loginName;
       this.nick = nick;
       this.pwd = pwd;
       this.status = status;
       this.ip = ip;
       this.port = port;
       this.friendsesForOwner = friendsesForOwner;
       this.friendsesForFriend = friendsesForFriend;
    }
   
     @Id @GeneratedValue(strategy=IDENTITY)
    
    @Column(name="id", unique=true, nullable=false)
    public Integer getId() {
        return this.id;
    }
    
    public void setId(Integer id) {
        this.id = id;
    }
    
    @Column(name="loginName", unique=true, length=10)
    public String getLoginName() {
        return this.loginName;
    }
    
    public void setLoginName(String loginName) {
        this.loginName = loginName;
    }
    
    @Column(name="nick", length=40)
    public String getNick() {
        return this.nick;
    }
    
    public void setNick(String nick) {
        this.nick = nick;
    }
    
    @Column(name="pwd", length=40)
    public String getPwd() {
        return this.pwd;
    }
    
    public void setPwd(String pwd) {
        this.pwd = pwd;
    }
    
    @Column(name="status", length=1)
    public Character getStatus() {
        return this.status;
    }
    
    public void setStatus(Character status) {
        this.status = status;
    }
    
    @Column(name="ip", length=15)
    public String getIp() {
        return this.ip;
    }
    
    public void setIp(String ip) {
        this.ip = ip;
    }
    
    @Column(name="port")
    public Integer getPort() {
        return this.port;
    }
    
    public void setPort(Integer port) {
        this.port = port;
    }
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="usersByOwner")
    public Set<Friends> getFriendsesForOwner() {
        return this.friendsesForOwner;
    }
    
    public void setFriendsesForOwner(Set<Friends> friendsesForOwner) {
        this.friendsesForOwner = friendsesForOwner;
    }
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="usersByFriend")
    public Set<Friends> getFriendsesForFriend() {
        return this.friendsesForFriend;
    }
    
    public void setFriendsesForFriend(Set<Friends> friendsesForFriend) {
        this.friendsesForFriend = friendsesForFriend;
    }




}


